//
//  CRBCustomAddPopView.m
//  ChampsARotate
//
//  Created by 吴凡 on 2018/12/29.
//  Copyright © 2018 Logan.Fan. All rights reserved.
//

#import "CRBCustomAddPopView.h"

@implementation CRBCustomAddPopView

- (instancetype)init {
    if (self = [super init]) {
        _popimageView = [UIImageView new];
        _popimageView.image = [UIImage imageNamed:@"common_back"];
        [self addSubview:_popimageView];
        [_popimageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self).offset(0);
            make.centerX.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(11.5, 22.5));
        }];
        __weak __typeof(self)weakSelf = self;
//            __weak __typeof(self)weakSelf = self;

        _biggerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _biggerBtn.backgroundColor = [UIColor clearColor];
        [self addSubview:_biggerBtn];
        [_biggerBtn addTarget:self action:@selector(popAction:) forControlEvents:UIControlEventTouchUpInside];
        [_biggerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(weakSelf.popimageView);
            make.size.mas_equalTo(CGSizeMake(35, 35));
        }];
    }
    return self;
}

- (void)popAction:(id)sender {
    if (_popBlock) {
        _popBlock();
    }
}
@end
